using Atlantic.XpoAutomaticProperties;
using DevExpress.Xpo;

namespace Tests.ObjectModel
{
   [XpoAutomaticProperties]
   public abstract class Entity : XPObject, IPropertyChangedNotifier
   {
      #region Constructors

      protected Entity()
      {
         // This constructor is used when an object is loaded from a persistent storage.
         // Do not place any code here.
      }

      protected Entity(Session session)
         : base(session)
      {
         // This constructor is used when an object is loaded from a persistent storage.
         // Do not place any code here.
      }

      #endregion

      #region Methods

      /// <summary>
      /// Notifies of a change to a property value.
      /// </summary>
      /// <param name="propertyName">Name of the changed property.</param>
      /// <param name="oldValue">The old value.</param>
      /// <param name="newValue">The new value.</param>
      void IPropertyChangedNotifier.OnChanged(string propertyName, object oldValue, object newValue)
      {
         base.OnChanged(propertyName, oldValue, newValue);
      }

      #endregion
   }
}